<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <script src="https://cdn.bootcss.com/jquery/1.2.3/jquery.min.js"></script>
  <title>Document</title>
</head>
<body>
  <div id="div1">
    1
  </div>
  <div id="div1">
    2
  </div>
  <div>
    <div>
      <div>
        <div>
          <span id="span1">span1</span>
        </div>
      </div>
    </div>
  </div>
  <span id="span1">span1-2</span>
  <script>
    console.log(document.getElementById('div1').innerHTML);
    console.log($('#div1').length, $('#div1').html());
    console.log(document.getElementById('span1').innerHTML);
    console.log($('#span1').length, $('#span1').html());
  </script>
</body>
</html>